FROM eclipse-temurin:11-jdk

WORKDIR /app

COPY target/demo-0.0.1-SNAPSHOT.jar app.jar
COPY config/application.yml /app/config/application.yml
COPY config/logback-spring.xml /app/config/logback-spring.xml

EXPOSE 8080
VOLUME ["/app/logs"]

ENTRYPOINT ["java", "-jar", "app.jar", \
  "--spring.config.location=classpath:/config/application.yml", \
  "--spring.profiles.active=prod", \
  "--spring.redis.host=redis-server", \
  "--spring.redis.port=6379", \
  "--spring.session.store-type=redis"]
